// 针对admin的API操作都写在这里

import service from ".";

// 将所有的针对admin的请求，都封装到一个对象中
const patient = {
    search(params){
        return service.get(
            '/patient',
            {params},    // 传递参数
        ).then(response=>response.data);
    },
    edit(patient){
        return service.put(
            '/patient',
            patient,
        ).then(response=>response.data);
    },
    getLoginAdmin(){
        return service.get(
            '/admin/getLogin',
        ).then(response=>response.data);
    },
    verifyPassword(data){
    return service.post(
        '/patient/verifyPassword',
        data
    ).then(response=>response.data);
},
    add(patient){
        return service.post(
            '/patient',
            patient
        ).then(response=>response.data);
    },
};

export default patient;